/**
 * 
 */
package com.tosee.ws.model;

import com.tosee.model.dto.UserDto;

/**
 * @author robint
 */
public class WSUser extends WSObject {
    private String login;

    private String mdp;

    private String email;

    private Integer id;

    /**
     * Constructeur par défaut.
     */
    public WSUser() {
        super();
    }

    /**
     * Constructeur rapide
     */
    public WSUser(String _login, String _pwd) {
        this.login = _login;
        this.mdp = _pwd;

    }

    /**
     * Contructeur par copie
     * 
     * @param _UserDto
     */
    public WSUser(UserDto _userDto) {
        if(_userDto != null) {
            email = _userDto.getEmail();
            id = _userDto.getId();
            login = _userDto.getLogin();
            mdp = _userDto.getMdp();
        }
    }

    /**
     * Methode de transformation du WSUser en userDto
     */
    public UserDto toDto(UserDto _userDto) {
        UserDto retour = _userDto;
        if(retour == null) {
            retour = new UserDto();
        }
        retour.setEmail(email);
        retour.setLogin(login);
        retour.setMdp(mdp);

        return retour;
    }

    /**
     * @return the login
     */
    public String getLogin() {
        return login;
    }

    /**
     * @param login the login to set
     */
    public void setLogin(String login) {
        this.login = login;
    }

    /**
     * @return the id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the mdp
     */
    public String getMdp() {
        return mdp;
    }

    /**
     * @param mdp the mdp to set
     */
    public void setMdp(String mdp) {
        this.mdp = mdp;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

}
